package it.antonio.ilpizze.db.io;

import java.io.File;
import java.nio.ByteBuffer;

public abstract class IOFile implements IOConstants {
	
	

	public abstract byte[] readBytes(int size);
	public abstract ByteBuffer readByteBuffer(int size);
	public abstract String readString();
	public abstract int readInt();
	public abstract boolean readBoolean();
	public abstract long readLong();
	public abstract short readShort();
	public abstract float readFloat();
	public abstract double readDouble();
	public abstract byte readByte();
	
	public abstract void writeBytes(byte[] bytes);
	public abstract void writeByteBuffer(ByteBuffer buffer);
	public abstract void writeString(String value);
	public abstract void writeInt(int value);
	public abstract void writeBoolean(boolean value);
	public abstract void writeLong(long value);
	public abstract void writeShort(short value);
	public abstract void writeFloat(float value);
	public abstract void writeDouble(double value);
	public abstract void writeByte(byte value);
	
	public abstract void synch();
	public abstract long position();
	public abstract void position(long position);
	public abstract void open();
	public abstract void close();
	public abstract int size();
	public abstract String name();
	public abstract boolean lock(int milliseconds);
	public abstract void unlock();
	public abstract boolean isLocked();
	public abstract boolean delete();
	public abstract File original();
	public abstract void renameTo(String string);
	public static IOFile mmap(File db, int resize_bytes) {
		return new IOMMapFile(db, resize_bytes);
	}
	
	
}
